<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>首页</title>
	<link rel="shortcut icon" href="favicon.ico">
	<link rel="stylesheet" href="css/themes/default/jquery.mobile-1.4.5.min.css">
	<link rel="stylesheet" href="_assets/css/jqm-demos.css">

</head>
<body>
<div data-role="page" id="page1">
	<div data-role="header" data-position="fixed">
		<h1>杭州师范大学</h1>
	</div>
	<div data-role="main" class="ui-content">
			<p>page content goes here </p>
			<a data-role="button"  href="#page2">跳转至第二页</a>
		<input type="text" name="" id="tel"  placeholder="tel"/>
			<input type="button" value="查询"  id="search-submit"/>
		<ul data-role="listview" data-inset="true">

		</ul>
	</div>
	<div data-role="footer" data-position="fixed">
		<div data-role="navbar" data-iconpos="top">
			<ul >
				<li ><a href="#" data-icon="phone" class="ui-btn-active">手机</a></li>
				<li><a href="#" data-icon="cloud">天气</a></li>
				<li><a href="#" data-icon="grid">其他</a></li>
				<li><a href="#" data-icon="home">主页</a></li>

			</ul>
	</div>

	</div>
</div>
<div data-role="page" id="page2">
	<div data-role="header" data-position="fixed">
		<h2>欢迎你来到第二个页面</h2>
	</div>
	<div data-role="main" class="ui-content">
		<p>it's the second page</p>
		<a href="#page1" >跳转至第一页</a>
	</div>
	<div data-role="footer" data-position="fixed">页面底部</div>
</div>
<!-- /page -->
<script src="js/jquery.js"></script>
<script src="_assets/js/index.js"></script>
<script src="js/jquery.mobile-1.4.5.min.js"></script>

<script>
	var url="http://cors.itxti.net/?ws.webxml.com.cn/Webservice/MobileCodeWS.asmx/getMobileCodeInfo?userId="
	var getTelInfo = function () {
		var tel = $('#tel').val();
		var pattern =/^((13[0-9]{1})|(15[0-9]{1}|(18[0-9]{1}))+\d{8})$/;
		if (pattern.test(tel)){
			alert(tel);
		$.get(url,{'mobileCode':tel}),function(data){
			console.log(data);

		}


	}
	 var bindEvent =function () {
		 $("#search-submit").on('click',getTelInfo);
		 
		 
	 }
	 $(document).on('pagecreate','#index',function () {
		 bindEvent();

	 })}
	
	
</script>
</body>
</html>
